package cn.tedu.oopTestConstructor.cn.tedu;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * @author SWJ
 * @create 2021-06-18 14:24
 * 本类用于测试编码转化流
 */
public class TestEncode {
    public static void main(String[] args) {
        OutputStreamWriter out = null;

        try {
            out=new OutputStreamWriter(new FileOutputStream("D:\\ready\\1.txt"),"gbk");
            out.write("今天周五");
            System.out.println("执行成功");
        } catch (Exception e) {
            System.out.println("执行失败");
            e.printStackTrace();
        } finally {
            try {
                out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
